<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>APR (Airport Rhapsody): queue.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">APR (Airport Rhapsody)
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Implementation based on monitors</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('queue_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">queue.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Problem name: Airport rhapsody.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdbool.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="prob_data_struct_8h_source.html">probDataStruct.h</a>&quot;</code><br/>
</div>
<p><a href="queue_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a8d32db5a6389c397f8cfc3b88c3acdaf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a8d32db5a6389c397f8cfc3b88c3acdaf">queueInit</a> (<a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *p_q)</td></tr>
<tr class="memdesc:a8d32db5a6389c397f8cfc3b88c3acdaf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Queue initialization.  <a href="#a8d32db5a6389c397f8cfc3b88c3acdaf">More...</a><br/></td></tr>
<tr class="separator:a8d32db5a6389c397f8cfc3b88c3acdaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27a0ac00de5a2c415ab514328d54c015"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a27a0ac00de5a2c415ab514328d54c015">queueIn</a> (<a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *p_q, unsigned int val)</td></tr>
<tr class="memdesc:a27a0ac00de5a2c415ab514328d54c015"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insertion of a value into the queue.  <a href="#a27a0ac00de5a2c415ab514328d54c015">More...</a><br/></td></tr>
<tr class="separator:a27a0ac00de5a2c415ab514328d54c015"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa06b6f0b2334b9ada58fd957319caf1a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#aa06b6f0b2334b9ada58fd957319caf1a">queueOut</a> (<a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *p_q, unsigned int *p_val)</td></tr>
<tr class="memdesc:aa06b6f0b2334b9ada58fd957319caf1a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieval of a value from the queue.  <a href="#aa06b6f0b2334b9ada58fd957319caf1a">More...</a><br/></td></tr>
<tr class="separator:aa06b6f0b2334b9ada58fd957319caf1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25d1d2fca3a5f34b001812c40d35323f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a25d1d2fca3a5f34b001812c40d35323f">queuePeek</a> (<a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *p_q, unsigned int pos)</td></tr>
<tr class="memdesc:a25d1d2fca3a5f34b001812c40d35323f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Peek at a value from the queue.  <a href="#a25d1d2fca3a5f34b001812c40d35323f">More...</a><br/></td></tr>
<tr class="separator:a25d1d2fca3a5f34b001812c40d35323f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4640dd80fccb766ab26d7b3bdebe15b5"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#a4640dd80fccb766ab26d7b3bdebe15b5">queueFull</a> (<a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *p_q)</td></tr>
<tr class="memdesc:a4640dd80fccb766ab26d7b3bdebe15b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test for queue full.  <a href="#a4640dd80fccb766ab26d7b3bdebe15b5">More...</a><br/></td></tr>
<tr class="separator:a4640dd80fccb766ab26d7b3bdebe15b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac87d99442961e0b9e31233c2025cd537"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="queue_8h.html#ac87d99442961e0b9e31233c2025cd537">queueEmpty</a> (<a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *p_q)</td></tr>
<tr class="memdesc:ac87d99442961e0b9e31233c2025cd537"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test for queue empty.  <a href="#ac87d99442961e0b9e31233c2025cd537">More...</a><br/></td></tr>
<tr class="separator:ac87d99442961e0b9e31233c2025cd537"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Problem name: Airport rhapsody. </p>
<p>(interface file)</p>
<p>Concept: António Rui Borges</p>
<p>Queue management.</p>
<p>The following operations are defined: </p>
<ul>
<li>initialization </li>
<li>insertion of a value </li>
<li>retrieval of a value </li>
<li>test for queue full </li>
<li>test for queue empty.</li>
</ul>
<dl class="section author"><dt>Author</dt><dd>António Rui Borges - November 2013 </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ac87d99442961e0b9e31233c2025cd537"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool queueEmpty </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *&#160;</td>
          <td class="paramname"><em>p_q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Test for queue empty. </p>
<pre class="fragment">   The function fails if a null pointer is passed as a parameter.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_q</td><td>pointer to the location where the queue is stored</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code>, if the queue is empty </dd>
<dd>
<code>false</code>, otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a4640dd80fccb766ab26d7b3bdebe15b5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool queueFull </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *&#160;</td>
          <td class="paramname"><em>p_q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Test for queue full. </p>
<pre class="fragment">   The function fails if a null pointer is passed as a parameter.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_q</td><td>pointer to the location where the queue is stored</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code>, if the queue is full </dd>
<dd>
<code>false</code>, otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a27a0ac00de5a2c415ab514328d54c015"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void queueIn </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *&#160;</td>
          <td class="paramname"><em>p_q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Insertion of a value into the queue. </p>
<pre class="fragment">   The function fails if a null pointer is passed as a parameter or the queue is full.
   Nothing is stored if the function fails.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_q</td><td>pointer to the location where the queue is stored </td></tr>
    <tr><td class="paramname">val</td><td>value to be stored </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8d32db5a6389c397f8cfc3b88c3acdaf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void queueInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *&#160;</td>
          <td class="paramname"><em>p_q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Queue initialization. </p>
<pre class="fragment">   Queue will be empty after it.
   The function fails if a null pointer is passed as a parameter.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_q</td><td>pointer to the location where the queue is stored </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa06b6f0b2334b9ada58fd957319caf1a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void queueOut </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *&#160;</td>
          <td class="paramname"><em>p_q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>p_val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieval of a value from the queue. </p>
<pre class="fragment">   The function fails if a null pointer is passed as a parameter or the queue is empty.
   Nothing is retrieved if the function fails.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_q</td><td>pointer to the location where the queue is stored </td></tr>
    <tr><td class="paramname">p_val</td><td>pointer to the location where the retrieved value is to be stored </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a25d1d2fca3a5f34b001812c40d35323f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int queuePeek </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_q_u_e_u_e.html">QUEUE</a> *&#160;</td>
          <td class="paramname"><em>p_q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pos</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Peek at a value from the queue. </p>
<pre class="fragment">   The function fails if a null pointer is passed as a parameter or the queue is empty or
   position is out of range.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_q</td><td>pointer to the location where the queue is stored </td></tr>
    <tr><td class="paramname">pos</td><td>queue position to be peeked</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the peeked value, if there is one </dd>
<dd>
<code>EMPTYPOS</code>, otherwise </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="queue_8h.html">queue.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.3.1 </li>
  </ul>
</div>
</body>
</html>
